<?php
/* @var $this ColorController */
/* @var $model Color */
$this->pageTitle = Yii::app()->name . ' - '.Yii::t('default', 'Product');
$this->breadcrumbs=array(
	Yii::t('default', 'Products'),
);

$this->menu=array(
array('label'=>Yii::t('default', 'Create'), 'url'=>array('create')),
);
?>

<h3>
<?php echo Yii::t('default', 'List').' '.Yii::t('default', 'Products') ?>
</h3>

<?php 
$pageSize = Yii::app()->user->getState('pageSize', 10);

$this->widget('zii.widgets.grid.CGridView', array(
  'id'           => 'product-grid',
  'dataProvider' => $model->search(),
  'filter'       => $model,
  'pager'        => array
	(
    'firstPageLabel'       => '&lt;&lt;',
    'prevPageLabel'        => '&lt;',
    'nextPageLabel'        => '&gt;',
    'lastPageLabel'        => '&gt;&gt;',
    'footer'               =>'',
    'header'               =>'',
    'selectedPageCssClass' => 'selected',
    'firstPageCssClass'    => '',
    'lastPageCssClass'     => '',
    'nextPageCssClass'     => '',
    'previousPageCssClass' => '',
    'internalPageCssClass' => '',
    'htmlOptions'          => array(
	    'class' => ''
	  )
	),
  'pagerCssClass' => 'pagination',
  'columns'       =>array(
		array(
      'value'  => $this->stt_gridview,
      'filter' => '',
    ),
    'name',
    array(
      'name'  => 'categoryID',
      'value' => 'CategoryLang::model()->getName($data->categoryID)',
    ),
    'price',
    array(
      'name' => 'description',
      'type' => 'raw'
    ),
    array(
      'name'  =>'enabled',
      'value' =>'($data->enabled==1)?Yii::t("default", "Yes"):Yii::t("default", "No")'
		),
		array(
			'class'=>'CButtonColumn',
		),
	),
	'htmlOptions' => array(
	  'class' => ''
  )
)); ?>
<div class="row_per_page">
<?php 
  $all = $model->count();
  echo Yii::t('default', 'Row per page: ').CHtml::dropDownList('pageSize',$pageSize,array(10=>10,20=>20,50=>50,$all=>Yii::t('default', 'All')),array(
        'onchange'=>"$.fn.yiiGridView.update('product-grid',{ data:{pageSize: $(this).val() }})",
    ))
?>
</div>